import random
# def makeSeq():
#     seq = []
#     for i in range(65,91):
#         seq.append(i)
#     for i in range(97, 123):
#         seq.append(i)
#     return seq
#
# def getCode(n):
#     str = ""
#     for i in range(n):
#         # 生成一个随机数  从65到90 或者 97到122
#         # num = random.randint(65,90)
#         seq = makeSeq()
#         num = random.choice(seq)
#         # 将数字转成对应的字母
#         char = chr(num)
#         # 将每一次生成的随机字母拼接到str字符串中
#         str += char
#     return str

def getCode(n):
    str = ""
    for i in range(n):
        # 生成一个随机数  从65到90 或者 97到122
        num = random.randint(65,122)
        if (num <= 90 or num>=97):
            # 将数字转成对应的字母
            char = chr(num)
            # 将每一次生成的随机字母拼接到str字符串中
            str += char

    # 递归!!!!!!!
    if(len(str) < n):
        str += getCode(n - len(str))

    return str
